﻿Public MustInherit Class NewImageCommand
    Inherits ImageCommandBase
    Protected _width As Integer
    Protected _height As Integer
    Public Sub New(ByVal ImageName As String, ByVal Width As Integer, ByVal Height As Integer)
        MyBase.New(ImageName)
        _width = Width
        _height = Height
    End Sub
    Protected NotOverridable Overrides Sub ExecuteCommand()
        Try
            If _height = 0 Then _height = 1
            b = New Bitmap(_width, _height, Imaging.PixelFormat.Format32bppArgb)
            g = Graphics.FromImage(b)
            ManipulateBitmap()
            SaveBitmap()
        Catch ex As Exception
        Finally
            If g IsNot Nothing Then
                g.Dispose()
            End If
            If b IsNot Nothing Then
                b.Dispose()
            End If
        End Try
    End Sub
    Public MustOverride Sub ManipulateBitmap()
End Class
